#ifndef Net_EpollClientSocket_INCLUDED
#define Net_EpollClientSocket_INCLUDED

#include "runnable.h"
#include <iostream>

using namespace std;

class EpollClientSocket: public Runnable
{
public:
    EpollClientSocket():
        m_running(false)
    {}

    virtual ~EpollClientSocket()
    {}
    
    virtual void onStart()
    {
        m_running = true;
    }

    virtual void run() = 0;
    

    virtual void onFinished()
    {
        m_running = false;
    }

    bool        m_running;
};

class EpollClientFactory
{
public:
    EpollClientFactory(){}
    virtual ~EpollClientFactory(){}
    virtual EpollClientSocket* createClientSocket(int fd) = 0;
private:
    EpollClientFactory(const EpollClientFactory&);
    EpollClientFactory& operator = (const EpollClientFactory&);
};

#endif






